<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    // 求列表里的俩个数等于sum
let arr=[3,5,7,9,12,14,16]
let sum=15
for(let i=0; i<arr.length; i++){

    for(let j=0; j<arr.length-1; j++){

        if(arr[i]+arr[j]==sum){
            
            console.log(arr[i],arr[j])
        }
       
    }
   
}



    </script>
    
</body>
</html>